// MonUnitPanel.cpp : implementation file
//

#include "stdafx.h"
#include "kwclientcore.h"
#include "MonUnitPanel.h"
#include "RealtimeDataSurface.h"
#include "HistoricalDataSurface.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMonUnitPanel

CMonUnitPanel::CMonUnitPanel(long nCoalMineId, const CString& strMonUnitId)
{
  m_nPanelType = PT_MONUNIT;
  m_nCoalMineId = nCoalMineId;
  m_strMonUnitId = strMonUnitId;
  m_ColorScheme.m_crCaption = RGB(32, 127, 32);
  m_ColorScheme.m_crGradientCaption = RGB(160, 255, 160);
  m_ColorScheme.m_nActiveLabelBmpId = IDB_BITMAP_SELECTEDGREENLABEL;
  m_ColorScheme.m_nInactiveLabelBmpId = IDB_BITMAP_UNSELECTEDGREENLABEL;
}

CMonUnitPanel::~CMonUnitPanel()
{

}


BEGIN_MESSAGE_MAP(CMonUnitPanel, CBasePanel)
	//{{AFX_MSG_MAP(CMonUnitPanel)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CMonUnitPanel message handlers

void CMonUnitPanel::CreateSurfaces()
{
  bool bSuccess;

  CRealtimeDataSurface * pRealtimeDataSurface = new CRealtimeDataSurface(this);
  bSuccess = pRealtimeDataSurface->Create(this);
  ASSERT(bSuccess);
  AddSurface(pRealtimeDataSurface);

  CHistoricalDataSurface * pHistoricalDataSurface = new CHistoricalDataSurface(this);
  bSuccess = pHistoricalDataSurface->Create(this);
  ASSERT(bSuccess);
  AddSurface(pHistoricalDataSurface);

  ActivateSurface(pRealtimeDataSurface);
}

void CMonUnitPanel::Paint(CDC& dc)
{

}

void CMonUnitPanel::GetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
  CPoint sizeScreen(GetSystemMetrics(SM_CXFULLSCREEN), GetSystemMetrics(SM_CYFULLSCREEN)+GetSystemMetrics(SM_CYCAPTION));
  CPoint sizeFrame(GetSystemMetrics(SM_CXSIZEFRAME), GetSystemMetrics(SM_CYSIZEFRAME));
  lpMMI->ptMaxSize = CPoint(sizeScreen.x+sizeFrame.x*2, sizeScreen.y+sizeFrame.y*2);
  lpMMI->ptMaxTrackSize = lpMMI->ptMaxSize;
  lpMMI->ptMinTrackSize =  CPoint(620, 300); // CPoint(520, 300);
}
